package com.junsi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.junsi.bean.ApproveRole;
import com.junsi.mapper.ApproveRoleMapper;
import com.junsi.service.ApproveRoleService;
/**
 * 审批角色service
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ApproveRoleServiceIImpl implements ApproveRoleService{

	@Autowired
	private ApproveRoleMapper ApproveRoleMapper;
	
	@Override
	public List<ApproveRole> listAll() {
		List<ApproveRole> list=ApproveRoleMapper.listAll();
		return list;
	}

	@Override
	public ApproveRole findById(Integer id) {
		ApproveRole approveRole=ApproveRoleMapper.findById(id);
		return approveRole;
	}

	@Override
	public boolean insert(ApproveRole o) throws Exception {
		int result = ApproveRoleMapper.insert(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}

	@Override
	public boolean update(ApproveRole o) throws Exception {
		int result = ApproveRoleMapper.update(o);
		if (result == 1) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean delete(Integer id) {
		int result = ApproveRoleMapper.delete(id);
		if (result == 1) {
			return true;
		} else {
			return false;
		}

	}
}
